home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 58 / pcpp58a.iso / extras / quake 3 source / Q3A_ToolSource.exe / Main / DialogTextures.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-02  |  1.6 KB  |  69 lines

  1. // DialogTextures.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Radiant.h"
  6. #include "DialogTextures.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CDialogTextures dialog
  16.  
  17.  
  18. CDialogTextures::CDialogTextures(CWnd* pParent /*=NULL*/)
  19.     : CDialog(CDialogTextures::IDD, pParent)
  20. {
  21.     //{{AFX_DATA_INIT(CDialogTextures)
  22.         // NOTE: the ClassWizard will add member initialization here
  23.     //}}AFX_DATA_INIT
  24. }
  25.  
  26.  
  27. void CDialogTextures::DoDataExchange(CDataExchange* pDX)
  28. {
  29.     CDialog::DoDataExchange(pDX);
  30.     //{{AFX_DATA_MAP(CDialogTextures)
  31.     DDX_Control(pDX, IDC_LIST_TEXTURES, m_wndList);
  32.     //}}AFX_DATA_MAP
  33. }
  34.  
  35.  
  36. BEGIN_MESSAGE_MAP(CDialogTextures, CDialog)
  37.     //{{AFX_MSG_MAP(CDialogTextures)
  38.     ON_LBN_DBLCLK(IDC_LIST_TEXTURES, OnDblclkListTextures)
  39.     //}}AFX_MSG_MAP
  40. END_MESSAGE_MAP()
  41.  
  42. /////////////////////////////////////////////////////////////////////////////
  43. // CDialogTextures message handlers
  44.  
  45. void CDialogTextures::OnOK() 
  46. {
  47.     m_nSelection = m_wndList.GetCurSel();
  48.     CDialog::OnOK();
  49. }
  50.  
  51. void CDialogTextures::OnDblclkListTextures() 
  52. {
  53.   OnOK();
  54. }
  55.  
  56. BOOL CDialogTextures::OnInitDialog() 
  57. {
  58.     CDialog::OnInitDialog();
  59.   CStringArray sa;
  60.   FillTextureMenu(&sa);
  61.   m_nSelection = -1;
  62.   for (int i = 0; i < sa.GetSize(); i ++)
  63.   {
  64.     m_wndList.AddString(sa.GetAt(i));
  65.   }
  66.     return TRUE;  // return TRUE unless you set the focus to a control
  67.                   // EXCEPTION: OCX Property Pages should return FALSE
  68. }
  69.